<script type="text/javascript" src="/lib/FCKeditor/fckeditor.js"></script>
 <table width="100%">
    <tr>
    <td height="5"></td>
  </tr>
   <tr><td><h1><?php echo ($ctx->flag==0)?'Contact All Users':'Contact Users' ?></h1></td>
  </tr>
  <tr>
    <td height="5"></td>
  </tr>
  <tr>
    <td><form id="form1" name="form1" method="post" action="/admin-mvc/user/index/send-mail/" onsubmit="return validateRegistration();"><input type="hidden" name="userId" id="userId" value="${userIds}" /><input type="hidden" name="creby" id="creby" value="" />
      <table width="95%" border="0" align="left" cellpadding="5" cellspacing="0" class="form_box">
	  <tr>
          <td align="left">&nbsp;</td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td width="11%" align="right" valign="middle">To:</td>
          <td width="89%" align="left"  valign="middle">
          <?php if($ctx->flag==0) { ?> All Users <?php } else { ?>
         <select name="mailFrom" size="5" disabled="disabled"><option tal:repeat="opt1 resultUser" value="">${opt1/first_name} ${opt1/last_name} < ${opt1/email} ></option></select>
          <? } ?></td>
        </tr>
          <tr>
          <td align="right" valign="middle"><span class="red_txt">*</span>From:</td>
          <td align="left"  valign="middle"><select name="mailFrom" id="mailFrom" title="Please Select Sender's Name"><option value="">-- Please select Sender --</option><option tal:repeat="opt resultAdmin" value="${opt/first_name} ${opt/last_name}#${opt/email}">${opt/first_name} ${opt/last_name}</option></select>
          <br /><div  style="float:left; padding-right:130px; padding-top:8px;" id="divMailFrom" class="validationError"></div></td>
        </tr>
        <tr>
          <td align="right" valign="middle"><span class="red_txt">*</span>Subject:</td>
          <td align="left"  valign="middle"><input name="mailSubject" type="text" class="textfield" id="mailSubject" value="" title="Please Enter Subject"  size="100"/>
          <br />
          <div  style="float:left; padding-right:130px; padding-top:8px;" id="divMailSubject" class="validationError"></div></td>
        </tr>
        <tr>
          <td align="right" valign="middle"><span class="red_txt">*</span>Mail Body:</td>
          <td align="left"  valign="middle">
         
          <script type="text/javascript">
var oFCKeditor = new FCKeditor('mailBody',700,500);
oFCKeditor.BasePath = "/lib/FCKeditor/";
oFCKeditor.Create();

</script>
          <br /><div  style="float:left; padding-right:130px; padding-top:8px;" id="divMailBody" class="validationError"></div>          </td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="left"><input type="submit" name="send" id="send" value="Send"  class="input_bt"/>&nbsp;
            <input name="Input" type="button" value="Cancel" class="input_bt" onclick="location.href='/admin-mvc/user/'"/>            </td>
        </tr>
        <tr>
          <td align="left">&nbsp;</td>
          <td align="left">&nbsp;</td>
        </tr>
      </table>     
        </form>
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr></table>
<script type="text/javascript">
//<![CDATA[
function validate(element)
{		
		if($("#"+element).val()==''){
			
			var x= "div"+element;
		$("#div"+element).html($("#"+element).attr("title"));
		$("#div"+element).show('slow');
		$("#"+element).focus();
		return false;
	} else {
		$("#"+element).html('');
	}
}
function validateRegistration()
{
	if($('#mailFrom').val()==''){
		$('#divMailFrom').html($('#mailFrom').attr("title"));
		$('#divMailFrom').show('slow');
		$('#mailFrom').focus();
		return false;
	} else {
		$('#divMailFrom').html('');
	}
		
	if($('#mailSubject').val()==''){
		$('#divMailSubject').html($('#mailSubject').attr("title"));
		$('#divMailSubject').show('slow');
		$('#mailSubject').focus();
		return false;
	} else {
		$('#divMailSubject').html('');
	}
	if(FCKeditorAPI.GetInstance('mailBody').GetXHTML()==''){
		$('#divMailBody').html('Please Enter Mail Message');
		$('#divMailBody').show('slow');
		return false;
	} else {
		
			$('#divMailBody').html('');
	}
}
//]]>
</script>
